package Util;

import java.awt.Color;
import java.awt.Component;
import javax.swing.JTable;
import javax.swing.table.DefaultTableCellRenderer;

public class MiRenderColor extends DefaultTableCellRenderer{


    @Override
    public Component getTableCellRendererComponent ( JTable tbl, Object value, boolean selected, boolean focused, int row, int column )
    {        
//        setBackground(Color.white);//color de fondo
//        tbl.setForeground(Color.black);//color de texto
        try {
            if(column==2){
                setOpaque(true); 
                setBackground(new Color(Integer.parseInt(tbl.getValueAt(row, 0).toString(),16)));   
            }else{
                setOpaque(true); 
                setBackground(Color.WHITE); 
            }
        } catch (Exception e) {
            e.printStackTrace();
        }

        super.getTableCellRendererComponent(tbl, value, selected, focused, row, column);
        return this;
 }

}
